<?
include("config.php");

$link = mysql_connect ('localhost', DB_USER_NAME, DB_PASSWORD) or die ("Cannot join database");
mysql_select_db (DB_NAME);

$requete = "SELECT * FROM user WHERE pseudo LIKE '%" . $_POST['search'] . "%'";
$result = mysql_query ($requete);

echo 'Result:<br><br>';

while($row = mysql_fetch_array($result))
	{
		echo '<img width="48" height="48" align="middle" data-user-id="24744541" class="user-profile-link" src="avatar/' . $row['pseudo'] . '.jpg">';
		echo ' <a href="index.php?user=' . $row['pseudo'] . '">' . $row['pseudo'] . '</a><br><br>';
	}

mysql_close($link);

?>
